//
//  bAppViewController.m
//  bApp
//
//  Created by Guglielmo Buzzelli on 15/05/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "bAppViewController.h"


@interface bAppViewController ()

@end

@implementation bAppViewController
@synthesize rootView;
@synthesize scrollView;
@synthesize newsButton;

- (void)viewDidLoad
{
    [super viewDidLoad];


   /* UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:@"Show" style:UIBarButtonItemStyleBordered target:self action:@selector(goToContact)]; 
    
     [self setToolbarItems:[NSArray arrayWithObject:anotherButton]animated:YES];*/
    

    
    
    UIImage *shadow = [UIImage imageNamed:@"gallery_box_app_empty@2x.png"];
    
    /**************** Primo blocco pagina **********************/
    
    UIView *firstPart = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 200)];
    
    UIImageView *imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 130, 110)];
    imageView1.image = [UIImage imageNamed:@"fig1.png"];
    [firstPart addSubview:imageView1];
    [firstPart sendSubviewToBack:imageView1];
    
    UIImageView *shadow1 = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 143, 120)];
    shadow1.image = shadow;
    [firstPart addSubview:shadow1];

    
    
    UITextView *header1part1 = [[UITextView alloc]initWithFrame:CGRectMake(145, 0, 180, 30)];
    header1part1.text=@"Ristorante Sasseo";
    header1part1.backgroundColor = [UIColor clearColor];
    header1part1.textColor = [UIColor whiteColor];
    header1part1.editable = NO;
    [firstPart addSubview:header1part1];
    
    UITextView *text1part1 = [[UITextView alloc]initWithFrame:CGRectMake(145, 30, 180, 100)];
    text1part1.text=@"A Santa Maria della Versa, immerso nelle verdi colline della Valle Versa, vi aspetta per accogliervi con una cucina raffinata e un ambiente di classe";
    text1part1.backgroundColor = [UIColor clearColor];
    text1part1.editable = NO;
    [firstPart addSubview:text1part1];
    
    UIImageView *imgText2part1 = [[UIImageView alloc]initWithFrame:CGRectMake(10, 140, 300, 70)];
    imgText2part1.image = [UIImage imageNamed:@"box_text@2x.png"];
    
        UITextView *text2part1 = [[UITextView alloc]initWithFrame:CGRectMake(10, 10, 280, 50)];
        text2part1.text=@"Venite al Sasseo...per una ricorrenza speciale, per un evento particolare ma anche per il pranzo domenicale...Tutto questo è il ristorante Sasseo!";
        text2part1.backgroundColor = [UIColor clearColor];
    text2part1.editable = NO;
        [imgText2part1 addSubview:text2part1];
    
    [firstPart addSubview:imgText2part1];
    
    [self.scrollView addSubview:firstPart];
    
    /**************** Secondo blocco pagina ********************/
    
    UIView *secondPart = [[UIView alloc] initWithFrame:CGRectMake(0, 40, 100, 200)];
    
    UITextView *header1part2 = [[UITextView alloc]initWithFrame:CGRectMake(0, 170, 180, 30)];
    header1part2.text=@"La cantina";
    header1part2.backgroundColor = [UIColor clearColor];
    header1part2.textColor = [UIColor blackColor];
    header1part2.editable = NO;
    header1part2.font = [UIFont fontWithName:@"Helvetica" size:13.0];
    [secondPart addSubview:header1part2];
    
    UIImageView *imageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(10, 200, 300,100)];
    imageView2.image = [UIImage imageNamed:@"fig2.png"];
    [secondPart addSubview:imageView2];
    
    UIImageView *shadow2 = [[UIImageView alloc] initWithFrame:CGRectMake(1, 195, 326,113)];
    shadow2.image = shadow;
    [secondPart addSubview:shadow2];
    [secondPart sendSubviewToBack:shadow2];
    
    
    UIImageView *imgText1part2 = [[UIImageView alloc]initWithFrame:CGRectMake(10, 310, 300, 100)];
    imgText1part2.image = [UIImage imageNamed:@"box_text@2x.png"];
    
        UITextView *text2part2 = [[UITextView alloc]initWithFrame:CGRectMake(10, 10, 280, 80)];
        text2part2.text=@"Venite al Sasseo...per una ricorrenza speciale, per un evento particolare ma anche per il pranzo domenicale...Tutto questo è il ristorante Sasseo!";
        text2part2.backgroundColor = [UIColor clearColor];
        text2part2.editable = NO;
        [imgText1part2 addSubview:text2part2];
    
    [secondPart addSubview:imgText1part2];
    
    [self.scrollView addSubview:secondPart];
    
    


    /**************** Background *******************************/    
    
    self.scrollView.contentSize = CGSizeMake( self.scrollView.frame.size.width , self.scrollView.frame.size.height);
    
    UIImageView *backgroundImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"back_ground_app@2x.png"]];
    [self.view addSubview:backgroundImage ];
    [self.view sendSubviewToBack:backgroundImage];

}

-(void)goToContact:(id)sender {

    
}


- (void)viewDidUnload
{
    [self setRootView:nil];
    [self setScrollView:nil];
    [self setNewsButton:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

@end
